//
//  GRStoreMsgTableViewCell.m
//  YC_GRice
//
//  Created by luojinrong11 on 2018/8/24.
//  Copyright © 2018年 YeCai. All rights reserved.
//

#import "GRStoreMsgTableViewCell.h"

@implementation GRStoreMsgTableViewCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

-(void)setNewsModel:(GRNewsModel *)newsModel{
    _newsModel = newsModel;
    [self.goodImageView sd_setImageWithURL:[NSURL URLWithString:newsModel.thumbnails]];
    self.titleLabel.text = newsModel.title;
//    WEAKSELF
//    dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
//        NSData *data = [newsModel.content dataUsingEncoding:NSUnicodeStringEncoding];
//
//        NSDictionary *options = @{NSDocumentTypeDocumentAttribute: NSHTMLTextDocumentType};
//
//        NSAttributedString *html = [[NSAttributedString alloc]initWithData:data
//
//                                                                   options:options
//
//                                                        documentAttributes:nil
//
//                                                                     error:nil];
//        dispatch_async(dispatch_get_main_queue(), ^{
//                  weakSelf.contentLabel.attributedText = html;
//        });
//    });
    self.contentLabel.text = newsModel.subtitle;
    self.countLabel.text = [NSString stringWithFormat:@"%ld", newsModel.browse];
}
- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
